package com.sophossystems.client.asmon.dao;

import com.sophossystems.client.asmon.dao.UserDao;
import com.sophossystems.client.asmon.dto.UserDTO;
import com.sophossystems.client.asmon.dto.UserPkDTO;
import com.sophossystems.client.asmon.exceptions.DaoException;
import java.util.List;

public interface UserDao
{
	/**
	 * Method 'insert'
	 * 
	 * @param dto
	 * @return UserPk
	 */
	public UserPkDTO insert(UserDTO dto);

	/** 
	 * Updates a single row in the User table.
	 */
	public void update(final UserDTO dto) throws DaoException;
	
	
	public void changePassword(UserDTO dto) throws DaoException;

	/** 
	 * Deletes a single row in the User table.
	 */
	public void delete(UserPkDTO pk) throws DaoException;

	/** 
	 * Returns all rows from the User table that match the criteria 'idUser = :idUser'.
	 */
	public UserDTO findByPrimaryKey(int idUser) throws DaoException;

	/** 
	 * Returns all rows from the User table that match the criteria ''.
	 */
	public List<UserDTO> findAll() throws DaoException;

	/** 
	 * Returns all rows from the User table that match the criteria 'idUser = :idUser'.
	 */
	public List<UserDTO> findWhereIdUserEquals(int idUser) throws DaoException;

	/** 
	 * Returns all rows from the User table that match the criteria 'username = :username'.
	 */
	public List<UserDTO> findWhereUsernameEquals(String username) throws DaoException;
	/** 
	 * Returns if there's a.
	 */
   public UserDTO login (String username , String password) throws DaoException;
   
   public UserPkDTO findLastInsert() throws DaoException;

}
